package com.study_security.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.study_security.dto.MemberDTO;
import com.study_security.dto.ProjectDTO;
import com.study_security.dto.TaskDTO;
import com.study_security.entity.Task;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TaskMapper extends BaseMapper<Task> {
    List<TaskDTO> selectTasksByProjectName(@Param("projectName") String projectName);
    List<TaskDTO> selectTasksByProjectId(@Param("projectId") Long projectId);
    List<ProjectDTO> selectUserProjects(@Param("userId") Long userId);

    int updateTaskStatus(@Param("taskId") Long taskId);


    int insertTask(@Param("task") Task task);

    int deleteTask(@Param("taskId") Long taskId);

    List<MemberDTO> selectProjectMembers(@Param("projectId") Long projectId);

    int countByTaskIdUserId(@Param("taskId") Long taskId,@Param("userId") Long userId);
}
